#ifndef PROJECT_H
#define PROJECT_H

#include <QString>
#include <QList>

//#include "abstractcontainer.h"

class QDesignerWorkbench;
class QXmlStreamReader;
class QProgressDialog;
class DatabaseStorage;
class AbstractContainer;

class Project
{
public:
    Project(const QString &fileName);
    ~Project();
    bool isValid();
    QString fileFullName() const;
    bool write();
    bool read();

    QString path() const { return m_projectPath; }
    AbstractContainer* databases() { return m_databases; }
    QString script() { return  m_projectScript; }
    void setScript(const QString &scr) { m_projectScript = scr; }

    void setProjectName(const QString &name) { m_projectName = name; }
    QString projectName() { return m_projectName; }

    void setVersion(const QString &version) { m_projectVersion = version; }
    QString version() { return m_projectVersion; }

private:
    inline bool readForms(QXmlStreamReader* pXml, QProgressDialog *progress = 0);

    void saveScript();
    void loadScript();

private:
    QString m_projectPath;
    QString m_projectFile;
    QString m_projectName;
    QString m_projectVersion;
    QString m_projectScript;
    QString m_scriptFilename;

    QDesignerWorkbench *m_workbench;


    AbstractContainer *m_databases;
    AbstractContainer *m_forms;
};

#endif // PROJECT_H
